Skip to content

Add upstream change monitoring workflow with daily notifications to @sharpninja#1

Merged
sharpninja merged 2 commits intomainfrom
copilot/monitor-incoming-changes
Feb 23, 2026
Merged

Add upstream change monitoring workflow with daily notifications to @sharpninja#1
sharpninja merged 2 commits intomainfrom
copilot/monitor-incoming-changes

Conversation

Copy link

Copilot AI commented Feb 23, 2026

Adds a scheduled GitHub Actions workflow to continuously track divergence between this fork and microsoft/graphrag, keeping a running summary of outstanding changes and notifying @sharpninja on each update.

Description

Implements a daily workflow that fetches the upstream microsoft/graphrag main branch, computes commits not yet present in this fork, and maintains a single GitHub issue as a living summary — posting a new mention-comment each run to trigger a GitHub notification to @sharpninja.

Related Issues

Upstream monitoring task for sharpninja/graphrag fork.

Proposed Changes

  • .github/workflows/monitor-upstream.yml — new workflow with:
    • schedule (daily at 08:00 UTC) + workflow_dispatch triggers
    • Fetches microsoft/graphrag and counts/lists commits in upstream/main not yet merged into the fork (capped at 50 for readability)
    • Auto-creates the upstream-tracking label on first run if absent
    • First run: opens a new issue labelled upstream-tracking with the full pending-commit list and a comparison link
    • Subsequent runs: updates the issue title/body (reflecting current count) and adds a new comment mentioning @sharpninja to fire a GitHub notification
    • Permissions scoped to contents: read + issues: write only

Checklist

  • I have tested these changes locally.
  • I have reviewed the code changes.
  • I have updated the documentation (if necessary).
  • I have added appropriate unit tests (if applicable).

Additional Notes

The workflow uses git rev-list HEAD..upstream/main to determine outstanding commits, so the count reflects commits reachable from upstream main that are not ancestors of the fork's current HEAD. Only one tracking issue is kept open at a time; the workflow locates it by the upstream-tracking label.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…y sharpninja

Co-authored-by: sharpninja <16146732+sharpninja@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ongoing task to monitor changes from parent repo Add upstream change monitoring workflow with daily notifications to @sharpninja Feb 23, 2026
Copilot AI requested a review from sharpninja February 23, 2026 19:01
@sharpninja sharpninja marked this pull request as ready for review February 23, 2026 22:11
Copilot AI review requested due to automatic review settings February 23, 2026 22:11
@sharpninja sharpninja merged commit a3fde72 into main Feb 23, 2026
7 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a GitHub Actions workflow to monitor divergence between this fork (sharpninja/graphrag) and the upstream repository (microsoft/graphrag). The workflow runs daily at 08:00 UTC and maintains a single GitHub issue that tracks outstanding commits from upstream, notifying @sharpninja on each update.

Changes:

  • Added .github/workflows/monitor-upstream.yml with scheduled daily runs
  • Implements git-based commit comparison using git rev-list to count outstanding changes
  • Creates/updates a tracking issue with auto-generated summaries and @mentions for notifications

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


- name: Fetch upstream
run: |
git remote add upstream https://github.com/microsoft/graphrag.git
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The git remote add upstream command will fail on subsequent runs because the remote will already exist. This should use git remote add upstream ... || true or check if the remote exists first, or use git remote set-url upstream ... after checking.

Suggested change
git remote add upstream https://github.com/microsoft/graphrag.git
git remote add upstream https://github.com/microsoft/graphrag.git 2>/dev/null || git remote set-url upstream https://github.com/microsoft/graphrag.git

Copilot uses AI. Check for mistakes.
Comment on lines +102 to +111
// Add a comment so @sharpninja receives a new notification
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
body:
`@sharpninja **Update ${now}**: ` +
`**${count}** outstanding change(s) from upstream detected.\n\n` +
`[View full comparison](${comparisonUrl})`,
});
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow will create a new comment on every run (including when count is 0), which could generate unnecessary notifications. Consider only adding a comment when the count has changed or when there are actually outstanding changes. You could store the previous count in the issue body or check if the issue body has already been updated today.

Suggested change
// Add a comment so @sharpninja receives a new notification
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
body:
`@sharpninja **Update ${now}**: ` +
`**${count}** outstanding change(s) from upstream detected.\n\n` +
`[View full comparison](${comparisonUrl})`,
});
// Only add a comment (and generate a notification) when there are outstanding changes
if (count > 0) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
body:
`@sharpninja **Update ${now}**: ` +
`**${count}** outstanding change(s) from upstream detected.\n\n` +
`[View full comparison](${comparisonUrl})`,
});
} else {
console.log('No outstanding upstream changes; skipping notification comment.');
}

Copilot uses AI. Check for mistakes.

const now = new Date().toUTCString();
const comparisonUrl =
'https://github.com/microsoft/graphrag/compare/main...sharpninja:graphrag:main';
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comparison URL is incorrect. The format 'main...sharpninja:graphrag:main' compares the upstream main with the fork's main, but the direction is reversed. To show commits in upstream that aren't in the fork, it should be 'sharpninja:graphrag:main...microsoft:graphrag:main'. The three-dot syntax shows the symmetric difference, which may not be what's intended. Consider using 'sharpninja:graphrag:main..microsoft:graphrag:main' with two dots to show commits in upstream not in the fork.

Suggested change
'https://github.com/microsoft/graphrag/compare/main...sharpninja:graphrag:main';
'https://github.com/microsoft/graphrag/compare/sharpninja:graphrag:main..microsoft:graphrag:main';

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +31
echo "$COUNT" > /tmp/commit-count.txt
git log --oneline --no-merges -50 HEAD..upstream/main > /tmp/commit-list.txt 2>/dev/null || true
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using /tmp/ for temporary files works on Linux/macOS but the repository has workflows running on Windows (see python-integration-tests.yml, python-unit-tests.yml). If this workflow ever runs on Windows or if the pattern is copied to other workflows, it will fail. Consider using ${{ runner.temp }} which provides a cross-platform temporary directory path.

Copilot uses AI. Check for mistakes.
Comment on lines +93 to +99
// Update the issue body and title
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
title,
body,
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment mentions "@sharpninja" will receive a notification on each run, but the issue body on line 69 also contains "@sharpninja". This means the notification will be triggered both when the issue is created AND when it's updated (via the body update), in addition to the comment. Consider removing "@sharpninja" from the body to avoid duplicate notifications on updates.

Copilot uses AI. Check for mistakes.
Comment on lines +49 to +56
} catch {
await github.rest.issues.createLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: 'upstream-tracking',
color: '0075ca',
description: 'Tracks outstanding changes from the upstream microsoft/graphrag repository',
});
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error handling for the catch block on line 49 is too broad. If the label doesn't exist, it attempts to create it, but if the catch is triggered by a network error, rate limit, or permissions issue, it will fail when trying to create the label with the same error. Consider logging the error or checking specifically for a 404 status to ensure you're only creating the label when it doesn't exist.

Suggested change
} catch {
await github.rest.issues.createLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: 'upstream-tracking',
color: '0075ca',
description: 'Tracks outstanding changes from the upstream microsoft/graphrag repository',
});
} catch (error) {
if (error && error.status === 404) {
await github.rest.issues.createLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: 'upstream-tracking',
color: '0075ca',
description: 'Tracks outstanding changes from the upstream microsoft/graphrag repository',
});
} else {
console.error('Failed to ensure upstream-tracking label exists:', error);
throw error;
}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants